#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define len (256)
void main()
{	
    FILE * File1 = NULL, * File2 = NULL;
    char str1[len], str2[len];
    int i=0, a=0, b=0, c=0;
    File1 = fopen("test1.txt","r");
    File2 = fopen("test2.txt","r");

	while (a==b && c==0)
	{

	
	
		if (!feof(File1)) a++; else c++;
		if (!feof(File1)) b++; else c++;
		fgets(str1, len, File1);
		fgets(str2, len, File2);

		if (strcmp(str1, str2))
		{
			a++;
		    
		}
		i++;

	}

	if (feof(File1) && feof(File1) &&  a==b) printf("difference is not found \n");
	else printf("difference found in the line: %d\n", i);

    fclose(File1);
    fclose(File2);

    system("PAUSE");
}